package graphic;

import javax.swing.*;
import java.awt.*;

/**
 * @program: javaLearn
 * @description:
 * @author: renhai
 * @Date ：2021/12/20 22:18
 **/
public class MyJFrame2 extends JFrame {
    public MyJFrame2() {
        super("我的第一个FlowLayout布局");
        this.setBounds(400, 400, 400, 400);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.getContentPane().setLayout(new FlowLayout());
        this.getContentPane().add(new JPanel());
        this.getContentPane().add(new JButton("button1"));
        this.getContentPane().add(new JButton("button2"));
        this.getContentPane().add(new JButton("button3"));

        this.setVisible(true);    //设置框架的可见性
    }

    public static void main(String[] args) {
        new MyJFrame2();
    }
}
